<template>
  <!--  提供激活按钮-->
  <div>
    <el-button type="primary" @click="active">激活</el-button>
  </div>
</template>
<script>
// 获取路径中的参数
export default {
  name: 'Active',
  data() {
    return {
      // 获取路径中的参数
      shopId: null,
      activeCode: '',
    }
  },
  mounted() {
    this.shopId = this.$route.query.shopId;
    this.activeCode = this.$route.query.activeCode;
  },
  methods: {
    active() {
      this.$axios.get('/shop/active?shopId=' + this.shopId + '&activeCode=' + this.activeCode)
          .then(res => {
            if (res.data.code === 1) {
              this.$message({
                message: "激活成功！",
                type: 'success'
              });
            } else {
              this.$message({
                message: res.data.msg,
                type: 'error'
              });
            }
      })
    }
  }
}
</script>
<style lang="scss" scoped>

</style>